<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core'%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head>
	<%@include file="../include.jsp"%>
</head>
<body id="z_body">
	<div class="panel">
		<div class="panel-heading">
			<i class="icon icon-list"></i> 
			${act}警情性质
		</div>
		<div class="panel-body">
			<form class="form-horizontal" id="form1">
				<input type="hidden" name="act" value="${act}"/>
				
				<c:if test="${act == '修改'}">
						<input name="czType" value="edit" type="hidden"/>
					</c:if>
					<c:if test="${act == '新增'}">
						<input name="czType" value="add" type="hidden"/>
					</c:if>
					
				<div class="form-group">
					<label class="col-md-3 app_required">编号</label>
					<div class="col-md-6">
						<c:if test="${act == '新增'}">
							<input class="form-control" name="jqxzbh" value="${one.jqxzbh}" validType="notEmpty">
						</c:if>
						<c:if test="${act == '修改'}">
							<input class="form-control" name="jqxzbh" value="${one.jqxzbh}" readonly="readonly">
						</c:if>
					</div>
				</div>
				
				<div class="form-group">
					<label class="col-md-3 app_required">简称</label>
					<div class="col-md-6">
						<input class="form-control" name="jqxzjc" value="${one.jqxzjc}" validType="notEmpty">
					</div>
				</div>
				
				<div class="form-group">
					<label class="col-md-3"></label>
					<div class="col-md-6">
						<a class="btn btn-primary" onclick="save()">保存</a> &nbsp;
						<c:if test="${act == '修改'}">
						<a class="btn btn-default" href="javascript:;" onclick="window.parent.window.closeWindow();">取消</a>
					</c:if>
					<c:if test="${act == '新增'}">
						<a class="btn btn-default" onclick="history.go(-1)">取消</a>
					</c:if>
						
					</div>
				</div>
			</form>
			
		</div>
	</div>
	
	
<script type="text/javascript">
	$(function() {
		//注册表单验证插件
		$("#form1").zghValidator("init");
	});

	/**
	 * 保存
	 */
	function save() {
		//表单验证
		if(!$("#form1").zghValidator("validate")) {
			return;
		}
		//提交
		tool.save("save", $("#form1").serialize(), function(res) {
			var ctype = $("#form1 [name='czType']").val();
			if("add" == ctype){
				setTimeout(function(){history.go(-1);}, 800);
			}else{
				window.parent.window.$("#btn_query").click();
				window.parent.window.closeWindow();
			}
			
		});
	}
</script>

</body>
</html>